package com.itheima.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
@Configuration
@ComponentScan("com.itheima.service")
public class ServletConfig extends AbstractAnnotationConfigDispatcherServletInitializer {
    //其他
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{SpringConfig.class};
    }
    //bean
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{SpringMvcConfig.class};
    }
    //拦截
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
